const getBarOption = () => ({
  type: 'bar',
  stack: 'total',
  data: [],
})

const getSeriesData = () => [
  {
    name: '自营',
    itemStyle: {
      color: '#246EFF',
      borderRadius: 2,
    },
  },
  {
    name: '携程',
    itemStyle: {
      color: '#00B2FF',
      borderRadius: 2,
    },
  },
  {
    name: '飞猪',
    itemStyle: {
      color: '#FFE180',
      borderRadius: 2,
    },
  },
  {
    name: '哈啰',
    itemStyle: {
      color: '#80E2FF',
      borderRadius: 2,
    },
  },
  {
    name: '悟空',
    itemStyle: {
      color: '#F68B8B',
      borderRadius: 2,
    },
  },
  {
    name: '铁行',
    itemStyle: {
      color: '#56E2A8',
      borderRadius: 2,
    },
  },
  {
    name: '滴滴',
    itemStyle: {
      color: '#FF9A52',
      borderRadius: 2,
    },
  },
  {
    name: '飞租',
    itemStyle: {
      color: '#76C204',
      borderRadius: 2,
    },
  },
  {
    name: '其他',
    itemStyle: {
      color: '#B5C4C8',
      borderRadius: 2,
    },
  },
]

const getChartData = () => {
  const seriesData = getSeriesData()

  return {
    series_data: seriesData,
    series_bar_data: seriesData.map((item) => ({
      ...getBarOption(),
      ...item,
    })),
  }
}

export { getChartData }
